package common

import "github.com/micro/go-micro/v2/config"

type MySqlConfig struct {
	Host     string `json:"host"`
	Port     int64  `json:"port"`
	User     string `json:"user"`
	Pwd      string `json:"pwd"`
	Database string `json:"database"`
}

func GetMySqlFromConsul(config config.Config, path ...string) *MySqlConfig {
	mySqlConfig := &MySqlConfig{}
	config.Get(path...).Scan(mySqlConfig)
	return mySqlConfig
}
